def create_app(config_name):
    app = Flask(__name__)
    app.config.from_object(config[config_name])
    config[config_name].init_app(app)
    bootstrap.init_app(app)
    mail.init_app(app)
    moment.init_app(app)
    db.init_app(app)
    login_manager.init_app(app)
    pagedown.init_app(app)

    from .main import main as main_blueprint
    app.register_blueprint(main_blueprint)

    from .professor import pfs as professor_blueprint
    app.register_blueprint(professor_blueprint, url_prefix='/pfs')

    from .student import std as student_blueprint
    app.register_blueprint(student_blueprint, url_prefix='/std')

    from .registrar import rgs as registrar_blueprint
    app.register_blueprint(registrar_blueprint, url_prefix='/rgs')

    from .auth import auth as auth_blueprint
    app.register_blueprint(auth_blueprint, url_prefix='/auth')
    return app